﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using DataAccess;

namespace SmartHouseWcfService
{    
    public class SmartHouseWcfService : ISmartHouseWCF
    {
        private DataAccessor dataAccessor;

        public DataAccessor DataAccessor
        {
            get { return dataAccessor; }
            set { dataAccessor = value; }
        }

        public event EventHandler ConfigurationUpdated;

        public SmartHouseWcfService()
        {
        }

        public SmartHouseDataSet Get()
        {
            return dataAccessor.Get();
        }

        public void Set(SmartHouseDataSet ds)
        {
            dataAccessor.Save(ds);
        }

        public void Update()
        {
            
            if (ConfigurationUpdated != null)
                ConfigurationUpdated(this, new EventArgs());
        }
    }
}
